<?php

class access {
    public function index() {

        $ci =& get_instance();
        
        $class  = $ci->router->fetch_class();
        
        $allow = array("login","not_allowed");
        
        if (in_array($class,$allow)){
            return;
        }
        
        if ($ci->session->userdata('user_id') == FALSE){
            redirect(base_url()."login");
        }
        return;
    }
        
}

?>
